package com.ugoodtech.mdcc.core.model.mapper;

import com.ugoodtech.mdcc.core.model.entity.StationRegularServiceReport;
import com.ugoodtech.mdcc.core.model.entity.StationRegularServiceReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StationRegularServiceReportMapper {
    @SelectProvider(type=StationRegularServiceReportSqlProvider.class, method="countByExample")
    int countByExample(StationRegularServiceReportExample example);

    @DeleteProvider(type=StationRegularServiceReportSqlProvider.class, method="deleteByExample")
    int deleteByExample(StationRegularServiceReportExample example);

    @Delete({
        "delete from station_regular_service_report",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into station_regular_service_report (id, creation_time, ",
        "deleted, enabled, update_time, ",
        "answer_id, answer_other_id, ",
        "photo, is_new, question_id, ",
        "report, report_id)",
        "values (#{id,jdbcType=BIGINT}, #{creationTime,jdbcType=TIMESTAMP}, ",
        "#{deleted,jdbcType=BIT}, #{enabled,jdbcType=BIT}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{answerId,jdbcType=VARCHAR}, #{answerOtherId,jdbcType=VARCHAR}, ",
        "#{photo,jdbcType=VARCHAR}, #{isNew,jdbcType=BIT}, #{questionId,jdbcType=BIGINT}, ",
        "#{report,jdbcType=VARCHAR}, #{reportId,jdbcType=BIGINT})"
    })
    int insert(StationRegularServiceReport record);

    @InsertProvider(type=StationRegularServiceReportSqlProvider.class, method="insertSelective")
    int insertSelective(StationRegularServiceReport record);

    @SelectProvider(type=StationRegularServiceReportSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="answer_id", property="answerId", jdbcType=JdbcType.VARCHAR),
        @Result(column="answer_other_id", property="answerOtherId", jdbcType=JdbcType.VARCHAR),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_new", property="isNew", jdbcType=JdbcType.BIT),
        @Result(column="question_id", property="questionId", jdbcType=JdbcType.BIGINT),
        @Result(column="report", property="report", jdbcType=JdbcType.VARCHAR),
        @Result(column="report_id", property="reportId", jdbcType=JdbcType.BIGINT)
    })
    List<StationRegularServiceReport> selectByExample(StationRegularServiceReportExample example);

    @Select({
        "select",
        "id, creation_time, deleted, enabled, update_time, answer_id, answer_other_id, ",
        "photo, is_new, question_id, report, report_id",
        "from station_regular_service_report",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="answer_id", property="answerId", jdbcType=JdbcType.VARCHAR),
        @Result(column="answer_other_id", property="answerOtherId", jdbcType=JdbcType.VARCHAR),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_new", property="isNew", jdbcType=JdbcType.BIT),
        @Result(column="question_id", property="questionId", jdbcType=JdbcType.BIGINT),
        @Result(column="report", property="report", jdbcType=JdbcType.VARCHAR),
        @Result(column="report_id", property="reportId", jdbcType=JdbcType.BIGINT)
    })
    StationRegularServiceReport selectByPrimaryKey(Long id);

    @UpdateProvider(type=StationRegularServiceReportSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StationRegularServiceReport record, @Param("example") StationRegularServiceReportExample example);

    @UpdateProvider(type=StationRegularServiceReportSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StationRegularServiceReport record, @Param("example") StationRegularServiceReportExample example);

    @UpdateProvider(type=StationRegularServiceReportSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StationRegularServiceReport record);

    @Update({
        "update station_regular_service_report",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "answer_id = #{answerId,jdbcType=VARCHAR},",
          "answer_other_id = #{answerOtherId,jdbcType=VARCHAR},",
          "photo = #{photo,jdbcType=VARCHAR},",
          "is_new = #{isNew,jdbcType=BIT},",
          "question_id = #{questionId,jdbcType=BIGINT},",
          "report = #{report,jdbcType=VARCHAR},",
          "report_id = #{reportId,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(StationRegularServiceReport record);
}